package com.itheima.idea;

public class Student {
    private String name;
    private int age;

    public void setAge(int a){
        if(a>0 && a <99){
            age = a;
        }else{
            System.out.println("年龄有误");
        }
    }
    public int getAge(){
        return age;
    }



    public void setName(String a){
        name = a;
    }
    public String getName(){
        return name;
    }



    public void study(){
        System.out.println(age+"岁的"+name+"要好好学习");
    }
    }
